import React from "react";
import { connect } from "react-redux";

import { SET_LING } from '../actions/actions.js'



const Guiling = (props) => {
  const { setLing } = props;
  return (
    <div>
      <p style={{ color: "HotPink", fontSize: 18, fontWeight: 700, textAlign: "center" }} onClick={setLing}>点击归零</p>
    </div>
  );
}


const mapDispatchToProps = (dispatch) => {
  return {
    setLing: () => { dispatch(SET_LING); console.log('已归零!') },
  }
}

export default connect(null, mapDispatchToProps)(Guiling);
